﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QuanLyBanHang_NewApp.Entity
{
    public class SanPham
    {
        private long maSP;
        private string tenSP, loai, moTa;
        private int soLuong;
        private double gia;

        public SanPham()
        {

        }

        public SanPham(long masp, string tensp, string loai, double gia, int sl, string mota)
        {
            maSP = masp;
            tenSP = tensp;
            this.loai = loai;
            this.gia = gia;
            soLuong = sl;
            moTa = mota;
        }

        public long MaSP { get { return maSP; } set { maSP = value; } }
        public string TenSP { get { return tenSP; } set { tenSP = value; } }
        public double Gia { get { return gia; } set { gia = value; } }
        public int SoLuong { get { return soLuong; } set { soLuong = value; } }

        public string getAttribute(int index)
        {
            switch (index)
            {
                case 0: return maSP.ToString(); 
                case 1: return tenSP;
                case 2: return loai;
                case 3: return gia.ToString(); 
                case 4: return soLuong.ToString(); 
                case 5: return moTa; 
                default: return "!error"; 
            }
        }

        public void setCount(int num)
        {
            soLuong = num;
        }
        public void setPrice(double gia)
        {
            this.gia = gia;
        }

    }
}
